package BaseLinkDatabase;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * Created by wangyg 
 * on 2017/3/13 10:37
 */
public class Test {
	public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException,
			InstantiationException, SQLException {

		String oracleUrl="jdbc:oracle:thin:@localhost:1521:Run";

		String url = "jdbc:mysql://localhost:3306/Run";
		String user = "root";
		String password = "root";

		Class.forName("com.mysql.jdbc.Driver");
		Connection connection = DriverManager.getConnection(url, user, password);
		if (!connection.isClosed())
			System.out.println("Succeeded connecting to the Database!");

		Statement statement = connection.createStatement();
//		PreparedStatement preparedStatement = connection.prepareStatement();
		String sql = "select * from account";
		ResultSet resultSet = statement.executeQuery(sql);

	}
}
